<!--  -->
<template>
  <div class='ranking-page'>
    <div class="ranking-baner">
      <div class="period" @click="examineOn">{{currentText}}</div>
      <div class="period p-bottom" @click="bonusOn">小红花明细</div>
      <div class="ranking-wrap">
        <h3>排行榜</h3>
        <p>{{time}}</p>
      </div>
    </div>
    <div class="ranking-tab" v-if="rankTabs.length > 0">
      <van-tabs v-model="active" :ellipsis="false" line-width="15px" title-active-color="#FE5E56" title-inactive-color="#00001C" @click="rankTabOn">
        <block v-for="(item,index) in rankTabs" :key="index" >
          <van-tab :title="item.name" :name="item.id" ></van-tab>
        </block>
      </van-tabs>
    </div>
    <div class="ranking-list">
      <div class="jackpot flex-a-c flex-j-sb" >
        <div class="jackpot-residue" >
          <h3 :class="jackpotClass">{{moneyInfo.pool || '0.00'}}</h3>
          <p :class="jackpotClass">奖金池累计剩余金额</p>
        </div>
        <div class="jackpot-residue" >
          <h3 :class="jackpotClass">{{moneyInfo.dividend || '0.00'}}</h3>
          <p :class="jackpotClass">当期奖金池分红总额</p>
        </div>
      </div>
      <div class="ranking-member ">
        <div class="member-haed flex-a-c ">
          <div class="rank-head">排行</div>
          <div class="member-title">会员</div>
          <div>小红花</div>
          <div class="money-right">预分红金额</div>
        </div>
        <div class="member-list" v-if="rankList.length > 0">
          <block v-for="(item,index) in rankList" :key="index">
            <div class="ranking-item flex-a-c ">
              <div class="rank">{{isCurrent?item.rank:item.ranking}}</div>
              <div class="flex-a-c  member-user">
                <img :src="item.avatar" />
                <p>{{item.nickname}}</p>
              </div>
              <div>{{isCurrent?item.nums:item.flower}}</div>
              <div class="rewards">{{(isCurrent?item.rewards:item.amounts) || '0.00'}}</div>
            </div>
          </block>
        </div>
        <van-empty description="暂无数据" v-else />
      </div>
    </div>

    <div class="mh-50"></div>

    <div class="ranking-footer flex-a-c">
      <div>{{userSelf.rank}}</div>
      <div class="flex-a-c flex-j-c ranking-user">
        <img :src="userSelf.avatar" />
        <p>我</p>
      </div>
      <div>{{userSelf.flower}}</div>
      <div>{{userSelf.rewards || '0.00'}}</div>
    </div>
  </div>
</template>

<script>
import index_controller from "./index_controller";
export default index_controller;

</script>
<style scoped>
  /* .member-user ::v-deep .van-image__img {
    width:20px;
  } */
</style>
<style lang="scss" scoped>
/* @import url(); 引入公共css类 */
  .ranking-page {
    .ranking-baner {
      height: 8.375rem;
      position: relative;
      background:url('https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/transparent-block-baner.png') center center;
      .period {
        position: absolute;
        right: 0;
        top:1.25rem;
        border-radius: 0.9375rem 0rem 0rem 0.9375rem;
        padding:0.3125rem 0.5rem;
        font-size: 0.625rem;
        line-height: 0.625rem;
        color: #FFFFFF;
        background-color: rgba($color: #000000, $alpha: 0.39);
        cursor: pointer;
      }
      .p-bottom {
        top:3.5rem;
      }
      .ranking-wrap {
        position: absolute;
        left: 0.75rem;
        top:2.375rem;
        text-align: left;
        h3 {
          font-size: 1.75rem;
          line-height: 1.75rem;
          color: #FFFFFF;
          text-align: left;
          display: inline-block;
          position: relative;
          padding:0 0.625rem 0  0;
          z-index: 5;
          &::after {
            content: '';
            width: 100%;
            
            height: 1.0625rem;
            background-color: #FFBB00;
            position: absolute;
            bottom: -0.375rem;
            left: 0;
            z-index: -1;
          }
        }
        p {
          font-size: 0.75rem;
          color: #FFFFFF;
          padding:0.875rem 0 0 0;
        }
      }
    }
    .ranking-tab {
      margin-bottom: 0.625rem;
    }
    .ranking-list {
      margin:0 0.75rem;
      border-radius: 0.3125rem;
      padding:0.75rem;
      background-color: #fff;
      .jackpot {
        background: rgba(255,137,36,0.1);
        border-radius: 0.1875rem;
        padding:0.75rem 0;
        .jackpot-residue {
          flex:0 0 50%;
          h3 {
            font-size: 1rem;
            color: #333333;
            font-weight: 500;
            padding:0 0 0.625rem 0;
          }
          p {
            color:#999999;
            font-size: 0.75rem;
          }
          .red {
            color: #fe5e56!important;
          }
        }
      }
     
      .ranking-member {
        padding:0.875rem 0 0 0;
        .member-haed {
          padding-bottom: 0.8125rem;
          border-bottom: 0.0625rem solid #F2F2F2;
          .money-right {
            text-align: right;
          }
          .rank-head {
            width:15%;
            // text-align: left;
          }
          .member-title {
            width: 32%;
          }
          div {
            font-size: 0.8125rem;
            line-height: 0.8125rem;
            color: #999999;
            width:28.5%;
          }
        }
        
      }
      .member-list {
        // padding:0.875rem 0 0 0;
        .ranking-item {
          // padding-bottom: 0.875rem;
          padding:0.875rem 0;
          border-bottom: 0.0625rem solid #F2F2F2;
          .member-user {
            text-align: left;
            width: 33%;
            p {
              padding-left: 0.25rem;
              font-size: 0.8125rem;
              overflow: hidden;//溢出隐藏
              text-overflow: ellipsis;
              white-space: nowrap;
            }
            img {
              width:1.25rem;
              height: 1.25rem;
              border-radius: 50%;
              margin:0;
            }
          }
          div {
            // flex:1;
            width:28.5%;
          }
          .rewards {
            text-align: right;
          }
          .rank {
            width: 15%;
          }
        }
      }
    }
    .mh-50 {
      height:3.125rem;
      clear: both;
    }
  }
  .ranking-footer {
    width:calc(23.4375rem - 1.5rem);
    position: fixed;
    bottom:4rem;
    border-radius: 0.3125rem;
    margin:0 0.75rem;
    padding:0.625rem 0;
    box-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0,0,0,0.1);
    background: #6E6E79;
    div {
      flex:1;
      font-size: 0.8125rem;
      color: #FFFFFF;
    }
    .ranking-user {
      p {
        padding-left: 0.25rem;
      }
      img {
        width:1.25rem;
        height: 1.25rem;
        border-radius: 50%;
        margin:0;
      }
    }
  }

</style>